<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('日期和时间')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-6">
            <div class="box float-e-margins">
                <!--<div class="box-title">
                    <h5>日期选择器 <small>https://github.com/smalot/bootstrap-datetimepicker</small></h5>
                </div>-->
                <div class="box-content">
                    <div class="form-group">
                        <label class="font-normal">简单示例</label>
                        <div class="input-group date">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            <input type="text" class="form-control" id="datetimepicker-demo-1" placeholder="yyyy-MM-dd HH:mm">
                        </div>
                    </div>


                    <div class="form-group">
                        <label class="font-normal">显示年月</label>
                        <div class="input-group date">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            <input type="text" class="form-control" id="datetimepicker-demo-4" placeholder="yyyy-MM">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="font-normal">显示年月日</label>
                        <div class="input-group date">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            <input type="text" class="form-control" id="datetimepicker-demo-2" placeholder="yyyy-MM-dd">
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="font-normal">显示年月日时分秒</label>
                        <div class="input-group date">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            <input type="text" class="form-control" id="datetimepicker-demo-3" placeholder="yyyy-MM-dd HH:mm:ss">
                            <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="font-normal">带清空的按钮</label>
                        <div class="input-group date form_date">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            <input class="form-control" size="16" type="text" readonly>
                            <span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
                        </div>
                    </div>

                    <div class="form-group">
                       <label class="font-normal">日期范围选择</label>
                        <div class="input-date-range input-group">
                            <input type="text" class="input-sm form-control" id="datetimepicker-startTime" placeholder="yyyy-MM-dd"/>
                            <span class="input-group-addon">到</span>
                            <input type="text" class="input-sm form-control" id="datetimepicker-endTime" placeholder="yyyy-MM-dd"/>
                        </div>
                    </div>
                    <hr>
                    <div class="form-group">
                        <!--<label class="font-normal">相关参数详细信息</label>
                        <div>
                            <a href="http://doc.ruoyi.vip/ruoyi/document/zjwd.html#bootstrap-datetimepicker" target="_blank">
                            http://doc.ruoyi.vip/ruoyi/document/zjwd.html#bootstrap-datetimepicker</a>
                        </div>-->
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script type="text/javascript">
    $(function(){
        <!-- datetimepicker示例 -->
        $("#datetimepicker-demo-1").datetimepicker();

        $("#datetimepicker-demo-2").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("#datetimepicker-demo-3").datetimepicker({
            format: "yyyy-mm-dd hh:ii:ss",
            autoclose: true
        });
        $("#datetimepicker-demo-4").datetimepicker({
            format: "yyyy-mm",
            minView: "month",
            autoclose: true
        });

        $('.form_date').datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("#datetimepicker-startTime").datetimepicker({
            format: 'yyyy-mm-dd',
            minView: "month",
            todayBtn:  true,
            autoclose: true,
            endDate : new Date(),
        }).on('changeDate', function(event) {
            event.preventDefault();
            event.stopPropagation();
            var startTime = event.date;
            $('#datetimepicker-endTime').datetimepicker('setStartDate', startTime);
        });

        $("#datetimepicker-endTime").datetimepicker({
            format: 'yyyy-mm-dd',
            minView: "month",
            todayBtn:  true,
            autoclose: true,
            endDate : new Date(),
        }).on('changeDate', function(event) {
            event.preventDefault();
            event.stopPropagation();
            var endTime = event.date;
            $("#datetimepicker-startTime").datetimepicker('setEndDate', endTime);
        });
    });
</script>
</body>
</html>
